package com.qf.vo;

import com.qf.exception.UserException;

public class ResultVoUtils {
    public static ResultVo success(Object data){
        ResultVo resultVo=new ResultVo(0,"成功" ,data );
        return resultVo;
    }
    public static ResultVo success(){
        ResultVo resultVo=new ResultVo(0, "成功", null);
        return resultVo;
    }

    public static ResultVo err(UserException ex){
        ResultVo resultVo=new ResultVo(ex.getCode(), ex.getMsg(), null);
        return resultVo;
    }

    public static ResultVo err(){
        ResultVo resultVo=new ResultVo(1, "失败",null );
        return resultVo;
    }
}
